/// <summary>
/// 单例基类
/// </summary>
public class BaseSingleton<T> where T : new()
{
    private static object locker = new object();

    /// <summary>
    /// 单例
    /// </summary>
    public static T Instance
    {
        get
        {
            if (instance == null)
            {
                lock (locker)
                {
                    if (instance == null)
                    {
                        instance = new T();
                    }
                }
            }

            return instance;
        }
    }

    private static T instance;
}
